import service from '@/utils/request'
import type {TradeMarkResonsepe,TradeMark} from './interface/trademark';

//品牌模块的接口
enum API_BASEURL{
    TRADEMARK ='/admin/product/baseTrademark/',
    ADD_TRADEMARK = '/admin/product/baseTrademark/save',
    UPDATE_TRADEMARK = '/admin/product/baseTrademark/update',
    DELETE_TRADEMARK = '/admin/product/baseTrademark/remove/'
}
//获取品牌品牌分页数据
export const reqTradeMarkList = (page:number,limit:number) => service.get<any,TradeMarkResonsepe>(API_BASEURL.TRADEMARK + `${page}/${limit}`);

//添加品牌与更新品牌
export const reqAddOrUpdateTradeMark = (data:TradeMark) =>{
    if(data.id){
        return service.put<any,any>(API_BASEURL.UPDATE_TRADEMARK,data);
    }else{
        return service.post<any,any>(API_BASEURL.ADD_TRADEMARK,data)
    }
}
//删除已有品牌
export const reqDeleteTradeMark = (id: number) => service.delete<any, any>(API_BASEURL.DELETE_TRADEMARK + id);


